﻿using ConfExpert.Forms.Base;
using DevExpress.XtraBars;
using DevTeam;
using System;

namespace ConfExpert.Forms.Destex
{
    public partial class Musteriler : XForm
    {
        public Musteriler()
        {
            InitializeComponent();
        }

        private void Musteriler_Load(object sender, EventArgs e)
        {
            gv.Init("DX_GetMusteriler");
            gv.AddSummary();
            gv.ClearColumnEdit("DX_MusteriId");
            gv.MakeColumnsReadOnly("DX_MusteriId");
            gv.SetCaptions("DX_MusteriId:No.", "Unvan:Ünvan", "Name:Ad");

            gv.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            gv.BestFitColumns();
        }

        //private void btnYeniMusteri_ItemClick(object sender, ItemClickEventArgs e)
        //{
        //    using (YeniMusteri ym = new YeniMusteri())
        //    {
        //        if (ym.ShowDialog() == DialogResult.OK)
        //            btnGuncelle.PerformClick();
        //    }
        //}

        private void btnGuncelle_ItemClick(object sender, ItemClickEventArgs e)
        {
            gv.RefreshDataSource("DX_GetMusteriler");
            gv.BestFitColumns();
        }

        private void btnKaydet_ItemClick(object sender, ItemClickEventArgs e)
        {
            gv.Update();
            btnGuncelle.PerformClick();
        }
    }
}
